Skip to content

Ensure runtime server exits after shutdown#708

Merged
vinistock merged 1 commit intomainfrom
04-27-ensure_runtime_server_exits_after_shutdown
May 1, 2026
Merged

Ensure runtime server exits after shutdown#708
vinistock merged 1 commit intomainfrom
04-27-ensure_runtime_server_exits_after_shutdown

Conversation

@vinistock
Copy link
Copy Markdown
Member

@vinistock vinistock commented Apr 27, 2026

A lot of our life cycle was getting really clunky and we are frequently seeing tests hang, especially on Windows. This PR aims to improve the situation:

  1. Ensure that we join the boot thread when deactivating the add-on. This one is mostly about tests. Tests quickly create new add-on instances, which boots the Rails app. If we don't join the boot thread, we risk finishing the tests before the Rails app is up and we may end up with orphaned processes
  2. Got rid of the force_kill approach. This was basically a brute force way of trying to ensure things were shutting down properly
  3. Started making sure that the runtime server calls exit!(0) once the main loop finishes, to terminate child processes with it
  4. Removed the process group ID stuff, which I don't believe was actually doing anything useful
  5. Started handling early termination of stdin in the runtime server, so that it shuts down gracefully if the pipe was closed on the other end

@vinistock vinistock self-assigned this Apr 27, 2026
Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@vinistock vinistock force-pushed the 04-27-ensure_runtime_server_exits_after_shutdown branch 3 times, most recently from 49158cd to eae4fb8 Compare April 28, 2026 18:56
@vinistock vinistock marked this pull request as ready for review April 28, 2026 19:56
@vinistock vinistock requested a review from a team as a code owner April 28, 2026 19:56
@vinistock vinistock requested review from alexcrocha and st0012 April 28, 2026 19:56
Comment thread lib/ruby_lsp/ruby_lsp_rails/addon.rb
@vinistock vinistock force-pushed the 04-27-ensure_runtime_server_exits_after_shutdown branch from eae4fb8 to 86df70f Compare May 1, 2026 13:32
@vinistock vinistock merged commit 9214feb into main May 1, 2026
61 checks passed
@vinistock vinistock deleted the 04-27-ensure_runtime_server_exits_after_shutdown branch May 1, 2026 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants